Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Discover] Hide the whole filter div instead of just the icons #11819

Merged

Conversation

weltenwort
Copy link
Member

@weltenwort weltenwort commented May 16, 2017

Since #11604 the background of the filter icons in the document table remained visible and covered part of the cell content even when the cell was not hovered. That was caused by moving from display: none on the filter div to opacity: 0 on the individual icons.

This PR moves the background styles from the filter div to the individual icons to prevent it from covering cell content when not hovered.

fixes #12061

@weltenwort weltenwort added Team:Platform-Design Team Label for Kibana Design Team. Support the Analyze group of plugins. Feature:Discover Discover Application :Discovery v5.5.0 v6.0.0 labels May 16, 2017
@weltenwort weltenwort self-assigned this May 16, 2017
Copy link
Contributor

@cjcenizal cjcenizal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Found an issue, but I think there's an easy solution.

.docTableRowFilterButton {
opacity: 1;
.table-cell-filter {
opacity: 1; /* 2 */
Copy link
Contributor

@cjcenizal cjcenizal May 16, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately, if you tab to the buttons, they won't become visible because these styles only apply when the focus state is on the parent. I think the best solution is to remove the background-color: @panel-bg; property from line 43, and change .docTableRowFilterButton to have these styles:

/**
 * 1. Align icon with text in cell.
 * 2. Use opacity to make this element accessible to screen readers and keyboard.
 * 3. Show on focus to enable keyboard accessibility.
 */
.docTableRowFilterButton {
  appearance: none;
  background-color: @panel-bg;
  border: none;
  padding: 0 3px;
  font-size: 14px;
  line-height: 1; /* 1 */
  display: inline-block;
  opacity: 0; /* 2 */

  &:focus {
    opacity: 1; /* 3 */
  }
}

This way the buttons themselves have the background color, so they will only obscure the text when the buttons are focused or the row is being hovered over.

@weltenwort weltenwort force-pushed the fix/doctable-cell-filter-background branch from e199cd2 to 8c15da6 Compare May 17, 2017 08:20
@weltenwort
Copy link
Member Author

@cjcenizal thanks for the explanation, fixed it

Copy link
Contributor

@cjcenizal cjcenizal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! One small detail and then we're good.

@@ -74,7 +73,7 @@ doc-table {
*/
.docTableRowFilterButton {
appearance: none;
background-color: transparent;
background-color: @panel-bg;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would also add this rule:

  padding: 0 3px;

and remove this rule:

  & + & {
    margin-left: 5px;
  }

This way we can avoid a transparent gap between the buttons.

Copy link
Member

@lukasolson lukasolson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I merged this PR with your other one so I could see what the filter icons look like. This looks better, but when I hover over a cell in the highlighted row, the background of the icons clashes:

image

@weltenwort
Copy link
Member Author

@lukasolson that's a good point

How about using a text shadow to create a contrast-increasing outline around the icons instead?

image
image

@cjcenizal what do you think of that?

@cjcenizal
Copy link
Contributor

cjcenizal commented May 18, 2017

@weltenwort I like your idea but I think the bits and pieces of the cell text that show around the icons adds too much visual noise. I think we can solve this by updating the rule in discover/styles/main.less on line 135 to be:

    .discover-table-row--highlight {
      td,
      .docTableRowFilterButton {
        background-color: #E2F1F6;
      }
    }

Then the background color of the icons will match the highlighted background color:

image

@weltenwort weltenwort force-pushed the fix/doctable-cell-filter-background branch from 8c15da6 to f8c1e68 Compare May 19, 2017 10:28
@weltenwort
Copy link
Member Author

Yes, that technically fixes it, but the coupling without an explicit block definition makes me cringe. It is merely a drop in an ocean of awful css in the doc table though, so here we go.

next up: doc table BEMification

@cjcenizal is there a high chance of conflict refactoring the doc table classes right now or would you say I'm safe to go ahead?

@cjcenizal
Copy link
Contributor

makes me cringe

I'm glad I'm not the only one! :)

I think you're safe to refactor the doc table classes. There's nothing in the UI Framework that interacts with it, as far as I know. And I'm not working on any code that will affect it either.

You're a brave man @weltenwort! Viel glück.

@weltenwort weltenwort force-pushed the fix/doctable-cell-filter-background branch from f8c1e68 to 44b3396 Compare May 31, 2017 10:42
@weltenwort
Copy link
Member Author

@lukasolson @cjcenizal ready for another look

Copy link
Contributor

@cjcenizal cjcenizal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! 🎸

@weltenwort
Copy link
Member Author

@lukasolson do you have any further objections?

Copy link
Member

@lukasolson lukasolson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@weltenwort weltenwort merged commit 30dcd59 into elastic:master Jun 9, 2017
weltenwort added a commit to weltenwort/kibana that referenced this pull request Jun 9, 2017
weltenwort added a commit to weltenwort/kibana that referenced this pull request Jun 9, 2017
chrisronline pushed a commit to chrisronline/kibana that referenced this pull request Jun 14, 2017
…ic#11819)

Since elastic#11604 the background of the filter icons in the document table remained visible and covered part of the cell content even when the cell was not hovered. That was caused by moving from display: none on the filter div to opacity: 0 on the individual icons.

This PR moves the background styles from the filter div to the individual icons to prevent it from covering cell content when not hovered.
stacey-gammon pushed a commit to stacey-gammon/kibana that referenced this pull request Jun 14, 2017
…ic#11819)

Since elastic#11604 the background of the filter icons in the document table remained visible and covered part of the cell content even when the cell was not hovered. That was caused by moving from display: none on the filter div to opacity: 0 on the individual icons.

This PR moves the background styles from the filter div to the individual icons to prevent it from covering cell content when not hovered.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Discover Discover Application release_note:fix review Team:Platform-Design Team Label for Kibana Design Team. Support the Analyze group of plugins. v5.5.0 v5.6.0 v6.0.0-beta1 v6.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

White label box(?) in log event context
6 participants